package top.beiermode.geektime.projects.user.validator.bean.validation;

import top.beiermode.geektime.projects.user.domain.User;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * TODO
 *
 * @author Chen Song
 * @since
 */
public class UserValidAnnotationValidator implements ConstraintValidator<UserValid, User> {

   private int idRange;

   public void initialize(UserValid annotation) {
      this.idRange = annotation.idRange();
   }

   public boolean isValid(User value, ConstraintValidatorContext context) {

      // 获取模板信息
      context.getDefaultConstraintMessageTemplate();
      return false;
   }
}
